//
//  SYBaseViewController.h
//  weizhegou
//
//  Created by sujeking on 2020/3/24.
//  Copyright © 2020 Facebook. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <React/RCTEventEmitter.h>
#import <React/RCTBridgeModule.h>



#import <TZImagePickerController.h>
#import <Toast.h>
#import <MBProgressHUD.h>
#import "TBCityIconFont.h"
#import "UIScrollView+HBRefresh.h"
#import <MJRefresh.h>
#import <SSAppRouter/SSAppRouter.h>
#import "ZCBaseUserManager.h"


#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

#define MAIN_THEME_COLOR = UIColorFromRGB(0xF9150F)

//
//  WZGFlexBaseVC.h
//  ZCJZ
//
//  Created by sujeking on 2019/11/8.
//  Copyright © 2019 jeking. All rights reserved.
//

typedef NS_ENUM(NSUInteger, BaseViewModelCmd) {
  BaseViewModelCmd_ResetUserInfo,
};



#import "FlexBaseVC.h"

@interface SYBaseViewController : UIViewController<UITableViewDelegate,UITableViewDataSource,RCTBridgeDelegate>
/// 返回按钮
@property (nonatomic, strong) UIButton *baseBackItem;
/// 导航栏左侧按钮
@property (nonatomic, strong) UIButton *baseLeftItem;
/// 导航栏右侧按钮
@property (nonatomic, strong) UIButton *baseRightItem01;
/// 导航栏右侧按钮第二个
@property (nonatomic, strong) UIButton *baseRightItem02;

@property (nonatomic, strong) NSUserDefaults *userDefault;

@property (nonatomic, strong) TZImagePickerController *tzvc;
@property (nonatomic, strong) UIView *nodataView;
@property (nonatomic, strong) ZCBaseUserModel *userModel;
@property (nonatomic, assign) bool isPush ;

@property (assign, nonatomic) BOOL maxleft;

@property (nonatomic, copy) NSDictionary *params;
@property (nonatomic, copy) NSString *navTitle;

@property (nonatomic, strong) RCTBridge *bridge;


/// 设置导航栏样式
- (void)baseSetNavBarStyle;
/// 返回按钮点击事件
- (void)basePopAction;
/// 设置导航左侧按钮【文字+事件】
- (void)setLeftItemWithTitle:(NSString *)title action:(SEL)sel;
/// 设置导航左侧按钮【图标+事件】
- (void)setLeftItemWithIcon:(UIImage *)icon action:(SEL)sel;
/// 设置导航右侧按钮【文字+事件】
- (void)setRightItemWithTitle:(NSString *)title action:(SEL)sel;
/// 设置导航右侧按钮【图标+事件】
- (void)setRightItemWithIcon:(UIImage *)icon action:(SEL)sel;
/// 设置导航右侧多个按钮【图标+事件】最多两个
- (void)setRightItemWithIcons:(NSArray <UIImage *>*)icons action:(NSArray<NSString *> *)sels;
/// 显示相册
- (void)showAlbum:(void(^)(NSMutableArray *result))callback;
/// 显示相机
- (void)showCamera:(void(^)(NSMutableArray *result))callback;

- (void)loadSelectVC;

- (UIImage *)navbarShadowImage;

- (UIView *)tableViewFooterView;
/// 显示空数据
- (UIView *)showNodataViewWithTipTitle:(NSString *)title imageName:(NSString *)imageName
                       buttonTitle:(NSString *)buttonTitle
                          callback:(void (^)(void))callback;
///移除空数据
- (void)hiddenNodataView;
/// 获取时间戳
- (NSString *)timestanp;
/// 弹出框
- (void)showAlert:(NSString *)title
          content:(NSString *)content
       actionStr1:(NSString *)as1
            style:(UIAlertActionStyle)style
        actionAc1:(void(^)(UIAlertAction * _Nonnull action))block1
       actionStr2:(NSString *)as2
            style:(UIAlertActionStyle)style2
         actionAc:(void(^)(UIAlertAction * _Nonnull action))block2;


/// 收集行为
- (void)baseCollectionActionWithKey:(NSString *)KeyStr
                             action:(NSString *)action
                               data:(id)data;


/// 进入商品详情
- (void)loadGoodsDetailVCWithGoodsId:(NSString *)ids seckillId:(NSString *)seckill_id;

/// 进入素材
- (void)loadMoreShareVC:(NSString *)goodsId;

/// 列表加入购物车
- (void)netAddGoods2ShoppingCar:(NSString *)sku_id nums:(NSInteger )num idstr:(NSString *)idstr;

- (void)setTableView:(UIScrollView*)scrollView
     noDataWithTitle:(NSString*)title
                 des:(NSString*)des
        andImageName:(NSString*)imageName;
@end


@interface BaseViewModel:RCTEventEmitter <RCTBridgeModule>
+ (void)sendMsg2RNWithCmd:(BaseViewModelCmd)cmd bridge:(RCTBridge *)bridge params:(NSDictionary *)dict;
@end
